from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget
from PyQt5.QtCore import QCoreApplication
import sys
# 加入该路径，防止出现模块找不到，且放到Ui_MainWindow的前面
sys.path.append('ui')
from ui.UiHelmet import Ui_MainWindow
import warnings

# 抑制警告
warnings.filterwarnings("ignore", category=DeprecationWarning)

class MyWindow(QMainWindow):
    def __init__(self):
        super(MyWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        # 初始化主窗口
        self.initMain()
        # 添加信号和槽
        self.signalconnect()

    def signalconnect(self):
        # 添加事件处理
        self.ui.exitBtn.clicked.connect(QCoreApplication.quit)

    def initMain(self):
        # self.show_width = 770
        # self.show_height = 480
        pass


if __name__ == '__main__':
    app = QApplication(sys.argv)

    win = MyWindow()
    win.show()

    sys.exit(app.exec_())